<template>
  <div class="login-container">


    <div class="login-main">

      <div class="login-title">维他希汀后台管理系统</div>
      <el-input type="text" class="login-input" placeholder="请输入用户名" v-model="name" /><br><br><br>
      <el-input type="password" class="login-input" placeholder="请输入密码" v-model="password" show-password /><br><br><br>

      <el-button class="login-btn" type="primary" @click="login">登录</el-button>
    </div>


  </div>


</template>

<script>


export default {
  name: 'LoginPage',
  components: {
  },
  data() {
    return {
      name: '',
      password: ''
    }
  },
  mounted() {
    // if (this.getCookie('token')) {
    //   this.$router.push("/Main/Feedback")
    // }
  },
  methods: {
    backTop() {
      window.scrollTo({
        top: 0,
        behavior: 'smooth'
      })
    },

    login() {
      console.log(';;;')

      this.$axios({
        method: 'post',
        url: '/api/adminLogin/login',
        data: { name: this.name, password: this.password }
      }).then(res => {


        this.$router.push("/Main/Feedback");
        console.log(res);
      })

    },


  }
}
</script>

<style scoped lang="less">
.login-container {

  display: flex;
  flex-direction: column;
  justify-content: space-around;
  background: url("../assets/login-bg.webp");
  width: 100%;
  height: 100vh;
  background-size: 100vw 100vh;


  .login-main {
    text-align: center;
    margin-left: 300px;
    width: 400px;
    height: 500px;

    // background-color: #8abcf1;
    // opacity: 0.1;
    .login-title {
      line-height: 100px;
      font-size: 20px;
      font-weight: 700;
    }

    .login-input {
      height: 40px;
      border-radius: 10px;

    }

    .login-btn {
      width: 100%;
      height: 40px;
    }
  }
}
</style>
